﻿#region Using

using Microsoft.Xna.Framework;
using XNgine.Misc;
using XNgine.Services;

#endregion

namespace XNgine.ObjectManagement
{
    public class ObjectManager : GameComponent, IObjectManagement
    {
        private readonly NamedItemCollection<IObject> _objects = new NamedItemCollection<IObject>();

        public ObjectManager() : base(XEngine.Instance) { }

        public NamedItemCollection<IObject> Objects
        {
            get { return _objects; }
        }

        public void AddObject(IObject obj)
        {
            _objects.Add(obj);
        }

        public void RemoveObject(IObject obj)
        {
            _objects.Remove(obj);
        }
    }
}